<template>
	<view class="" style="background-color: #FFFFFF;height: 100vh;">
		<view class="container">
			<view class="nav-box" :style="{'height':'30vh'}">
				<!-- 自定义导航栏 -->
				<view class="status_bar" :style="{'height':statusBarHeight+'px'}">
					<!-- uni-ui这里是状态栏 -->
				</view>
				<!-- 胶囊位置信息 -->
				<view class="nav-main flex align-center justify-center" :style="{height: navBarHeight+'px'}">
					<view class="nav-main-back" @click="goBack">
						<uni-icons type="back" size="26" color="#2c2c2c"></uni-icons>
					</view>
					<text class="nav-main-title">推流数据</text>
				</view>
			</view>
			<view class="content">
				<view class="content-user">
					<image :src="user.path" mode="widthFix" style="width: 96rpx;height: 96rpx;border-radius: 50%;"></image>
					<view class="user-name-box">
						<view class="user-name">
							<span>{{ user.name }}</span>
							<uni-icons type="forward" size="12" color="#2c2c2c"></uni-icons>
						</view>
						<view class="user-organization">
							全部组织
						</view>
						
					</view>
					<uni-icons type="scan" size="12" color="#2c2c2c"></uni-icons>
				</view>
			</view>
		</view>
		
	</view>
</template>

<script>
	export default {
		data() {
			return {
				user:{
					'path':this.$wanlshop.oss('/uploads/20231021/9fc4236eef00326e07e812f3eab39c38.jpg'),
					'name':'六享互联'
				},
				//总高度
				height: 0,
				//胶囊位置信息
				menuButtonRect: {},
				//状态栏的高度
				statusBarHeight: 0,
				//导航栏的高度
				navBarHeight: 0,
				data: [{
						'id': 1,
						'path': this.$wanlshop.oss('/uploads/20231021/9fc4236eef00326e07e812f3eab39c38.jpg'),
						'name': '张三',
						'money': 76538.98,
						'effective': 198
					},
					{
						'id': 2,
						'path': this.$wanlshop.oss('/uploads/20231021/9fc4236eef00326e07e812f3eab39c38.jpg'),
						'name': "李四",
						'money': 4372.87,
						'effective': 28761
					},
					{
						'id': 3,
						'path': this.$wanlshop.oss('/uploads/20231021/9fc4236eef00326e07e812f3eab39c38.jpg'),
						'name': '王二麻子',
						'money': 4372.87,
						'effective': 85
					},
					{
						'id': 4,
						'path': this.$wanlshop.oss('/uploads/20231021/9fc4236eef00326e07e812f3eab39c38.jpg'),
						'name': '小淘气',
						'money': 4372.87,
						'effective': 2190
					}
				],
			}
		},
		mounted() {

		},
		created() {
			this.getHeight();
		},
		methods: {
			//获取屏幕导航栏高度
			getHeight() {
				if (wx.canIUse('getMenuButtonBoundingClientRect')) {
					let sysInfo = wx.getSystemInfoSync(); //状态栏的高度
					this.statusBarHeight = sysInfo.statusBarHeight;
					// 胶囊位置信息
					let rect = wx.getMenuButtonBoundingClientRect();
					this.menuButtonRect = JSON.parse(JSON.stringify(rect));
					// 导航栏高度
					let navBarHeight = (rect.top - sysInfo.statusBarHeight) * 2 + rect.height;
					this.navBarHeight = navBarHeight;
					// 自定义导航栏的高度
					this.height = sysInfo.statusBarHeight + navBarHeight;
				} else {
					wx.showToast({
						title: '您的微信版本过低，界面可能会显示不正常',
						icon: 'none',
						duration: 4000
					});
				}
			},
			goBack() {
				uni.navigateBack();
			}
		}
	}
</script>

<style lang="scss" scoped>
	.status_bar {
		width: 100%;
		
	}
	.nav-box{
		background-image: url('https://cdn.enjoysix.com/uploads/20231023/tuiliuback.png');
	}
	.nav-main {
		position: relative;
		.nav-main-back {
			position: absolute;
			left: 10rpx;
		}

		.nav-main-title {
			font-size: 32rpx;
			font-family: PingFangSC-Medium, PingFang SC;
			font-weight: 500;
			color: #333B53;
			line-height: 44rpx;
		}
	}
	.container{
		position: relative;
		.content{
			width: 100%;
			position: absolute;
			top: 240rpx;
			padding: 0 36rpx 0;
			// background-color: #ffffff;
			.title{
				display: flex;
				justify-content: space-between;
				span{
					font-size: 24rpx;
					font-family: PingFangSC-Regular, PingFang SC;
					font-weight: 400;
					color: #B1B1B1;
					line-height: 34rpx;
				}
			}
		}
	}
	
</style>